package com.star.spring.sharding.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("t_address")
public class Address {
    @TableId(type = IdType.ASSIGN_ID)
    private Long addressId;
    private Long userId;
    private String addressName;
    private String detailAddress;

    // 构造函数
    public Address() {}

    public Address(Long userId, String addressName, String detailAddress) {
        this.userId = userId;
        this.addressName = addressName;
        this.detailAddress = detailAddress;
    }

    // Getter和Setter方法
    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAddressName() {
        return addressName;
    }

    public void setAddressName(String addressName) {
        this.addressName = addressName;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    @Override
    public String toString() {
        return "Address{" +
                "addressId=" + addressId +
                ", userId=" + userId +
                ", addressName='" + addressName + '\'' +
                ", detailAddress='" + detailAddress + '\'' +
                '}';
    }
}